package com.miracle9.game.dao;
import com.miracle9.game.entity.BusineInfo;
import org.hibernate.Query;
import org.springframework.stereotype.Repository;

@Repository
public class BusineInfoServiceDao extends SqlOperating<BusineInfo, Integer>
{
  public BusineInfo getBusineInfo(String admin, int busineId, int currentShiftType)
  {
    return (BusineInfo)q_CreateSqlFilter("from BusineInfo where admin=? and busineId=? and currentShiftType=?", new Object[] { admin, Integer.valueOf(busineId), Integer.valueOf(currentShiftType) });
  }
  
  public void updateEndTime(String endTime, int busineId, int currentShiftType)
  {
	  q_CreateSql("update BusineInfo set endTime = ?,shiftWorkStatus=1 where busineId=? and currentShiftType=?", new Object[] { endTime, Integer.valueOf(busineId), Integer.valueOf(currentShiftType) }).executeUpdate();
  }
}

